using System;
using Gtk;


using PNotebook;

public partial class MainWindow : Gtk.Window
{
	public MainWindow () : base(Gtk.WindowType.Toplevel)
	{
		Build ();
		
	}

	protected void OnDeleteEvent (object sender, DeleteEventArgs a)
	{
		Application.Quit ();
		a.RetVal = true;
	}
	protected virtual void OnAddActionActivated (object sender, System.EventArgs e)
	{
		MiTextView miTextView = new MiTextView();
		miTextView.FileName = entry.Text;
		miTextView.Load();
		//miTextView.FileName 
		miTextView.Visible = true;
		string label = DateTime.Now.ToString();
		notebook.AppendPage(miTextView, new Label(label));
		notebook.Visible = true;
	}
	
	protected virtual void OnApplyActionActivated (object sender, System.EventArgs e)
	{
		
		Label label = (Label)notebook.GetTabLabel(notebook.CurrentPageWidget);
		label.LabelProp = entry.Text;
	}
	
	
	
}
